package cn.nfwx.tv.util;

import android.content.Context;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;

/**
 * Created by dell on 2017/11/13.
 */

public class RecyclerViewUtil {
    public static void setLinearLayoutManagerWithoutDivder(Context context, RecyclerView recyclerView) {
        LinearLayoutManager layoutManager = new LinearLayoutManager(context);
        layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
        recyclerView.setLayoutManager(layoutManager);
    }

    public static void setLinearLayoutManagerHorizontalWithoutDivder(Context context, RecyclerView recyclerView) {
        LinearLayoutManager layoutManager = new LinearLayoutManager(context);
        layoutManager.setOrientation(LinearLayoutManager.HORIZONTAL);
        recyclerView.setLayoutManager(layoutManager);
    }

    public static void setLinearLayoutManagerWithDivder(Context context, RecyclerView recyclerView) {
        LinearLayoutManager layoutManager = new LinearLayoutManager(context);
        layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
        recyclerView.setLayoutManager(layoutManager);
    }

    public static void setGridLayoutManager(Context context, RecyclerView recyclerView,int cow) {
        GridLayoutManager manager = new GridLayoutManager(context, cow);
        recyclerView.setLayoutManager(manager);
    }
}
